package com;

import com.model.NewProperties;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class BeySpringBoot {

    @ConfigurationProperties(prefix = "newp")
    @Bean
    public NewProperties getNewProperties() {
        return new NewProperties();
    }

    @Autowired
    private NewProperties newProperties;

    @RequestMapping("newp")
    public String newp() {
        System.out.println(newProperties);
        return "Bey newProperties!";
    }

}
